/* ===============================================
   材质编辑器样式 - 面板版本
   =============================================== */

/* 面板紧凑版样式 */
.material-panel-compact {
    padding: 8px;
}

/* 材质信息（紧凑徽章） */
.material-info-compact {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

/* 材质选择器（紧凑版） */
.material-selector-compact {
    margin-bottom: 10px;
}

/* 材质类型选择器 */
.material-type-selector {
    margin-bottom: 10px;
}

.material-type-selector label {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    margin-bottom: 4px;
    padding-left: 2px;
}

.material-type-select {
    width: 100%;
    height: 32px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 0 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.material-type-select:hover {
    border-color: rgba(102, 126, 234, 0.4);
    background: rgba(0, 0, 0, 0.4);
}

.material-type-select:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.6);
    background: rgba(0, 0, 0, 0.4);
}

.material-type-display {
    width: 100%;
    height: 32px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 0 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    display: flex;
    align-items: center;
}

.material-type-hint {
    margin-top: 4px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    padding-left: 2px;
}

.material-selector-compact label {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    margin-bottom: 4px;
    padding-left: 2px;
}

.material-select-wrapper {
    position: relative;
    display: flex;
    gap: 4px;
}

.material-search-input {
    flex: 1;
    height: 32px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 0 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    transition: all 0.2s ease;
}

.material-search-input:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.6);
    background: rgba(0, 0, 0, 0.4);
}

.material-dropdown-btn {
    width: 32px;
    height: 32px;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.4);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.material-dropdown-btn:hover {
    background: rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.6);
}

.material-dropdown-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 240px;
    background: rgba(30, 30, 30, 0.98);
    border: 1px solid rgba(102, 126, 234, 0.4);
    border-radius: 4px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.material-dropdown-list::-webkit-scrollbar {
    width: 6px;
}

.material-dropdown-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.material-dropdown-list::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.4);
    border-radius: 3px;
}

.material-dropdown-list::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.6);
}

.material-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.material-dropdown-item:last-child {
    border-bottom: none;
}

.material-dropdown-item:hover {
    background: rgba(102, 126, 234, 0.15);
}

.material-dropdown-item.active {
    background: rgba(102, 126, 234, 0.25);
    border-left: 3px solid rgba(102, 126, 234, 0.8);
}

.material-dropdown-item .material-item-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.material-dropdown-item .material-item-content {
    flex: 1;
    min-width: 0;
}

.material-dropdown-item .material-item-name {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.material-dropdown-item .material-item-desc {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.material-dropdown-empty {
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
}

/* 材质浏览按钮 */
.material-browse-btn {
    padding: 0 12px;
    height: 32px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    border: 1px solid rgba(102, 126, 234, 0.4);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.material-browse-btn:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
    border-color: rgba(102, 126, 234, 0.6);
    transform: translateY(-1px);
}

/* 参数类别分隔线 */
.param-category-divider {
    margin: 12px 0 8px 0;
    padding: 4px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 材质浏览器 */
.material-browser-content {
    max-width: 900px;
    width: 90vw;
    max-height: 80vh;
}

.material-browser-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 60vh;
    overflow: hidden;
}

.material-browser-search {
    padding: 0 5px;
}

.material-search-field {
    width: 100%;
    height: 40px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 0 15px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    transition: all 0.2s ease;
}

.material-search-field:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.6);
    background: rgba(0, 0, 0, 0.4);
}

.material-browser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    padding: 5px;
    overflow-y: auto;
    max-height: calc(60vh - 80px);
}

.material-browser-grid::-webkit-scrollbar {
    width: 8px;
}

.material-browser-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.material-browser-grid::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.4);
    border-radius: 4px;
}

.material-browser-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.6);
}

.material-grid-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

/* 材质预览卡片 */
.material-preview-card {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.material-preview-card:hover {
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.material-preview-card.selected {
    border-color: rgba(102, 126, 234, 0.8);
    background: rgba(102, 126, 234, 0.1);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.material-preview-canvas-container {
    width: 100%;
    height: 140px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    position: relative;
    overflow: hidden;
}

.material-preview-canvas-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.material-preview-info {
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
}

.material-preview-name {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.material-preview-type {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 4px;
}

.material-type-badge {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
}

.info-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.info-badge.type {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(56, 142, 60, 0.2));
    border-color: rgba(76, 175, 80, 0.4);
    color: #81c784;
}

/* 参数网格布局 */
.param-grid {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
}

.param-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.param-item label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    padding-left: 2px;
}

.input-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.input-group input[type="color"] {
    width: 40px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px;
}

.input-group input[type="text"] {
    flex: 1;
    height: 28px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    padding: 0 6px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    font-family: 'Courier New', monospace;
}

.input-group input[type="range"] {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
}

.input-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.9);
}

.input-group input[type="number"] {
    width: 52px;
    height: 28px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    padding: 0 4px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    text-align: center;
}

/* 保存按钮（紧凑） */
.btn-save-compact {
    width: 100%;
    height: 32px;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.3), rgba(56, 142, 60, 0.3));
    border: 1px solid rgba(76, 175, 80, 0.5);
    border-radius: 4px;
    color: #81c784;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.btn-save-compact:hover {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.4), rgba(56, 142, 60, 0.4));
    border-color: rgba(76, 175, 80, 0.7);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(76, 175, 80, 0.3);
}

.btn-save-compact:active {
    transform: translateY(0);
}

.material-editor-info {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

/* ===============================================
   材质编辑器样式 - Modal版本（保留）
   =============================================== */

.material-editor-content {
    max-width: 1400px;
    width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.material-editor-body {
    display: flex;
    gap: 20px;
    flex: 1;
    overflow: hidden;
    padding: 20px;
}

/* ===============================================
   预览区域
   =============================================== */

.material-preview-container {
    flex: 0 0 450px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preview-label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.material-preview-canvas {
    flex: 1;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 8px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    overflow: hidden;
    position: relative;
    min-height: 400px;
}

.material-preview-canvas canvas {
    width: 100% !important;
    height: 100% !important;
}

.preview-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.preview-btn {
    padding: 8px 16px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.preview-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-1px);
}

/* ===============================================
   参数面板
   =============================================== */

.material-params-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-right: 8px;
}

.material-params-container::-webkit-scrollbar {
    width: 6px;
}

.material-params-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.material-params-container::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
}

.material-params-container::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

.material-param-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 15px;
}

.param-section-title {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

/* ===============================================
   参数行
   =============================================== */

.param-row {
    margin-bottom: 15px;
}

.param-row:last-child {
    margin-bottom: 0;
}

.param-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
}

.param-hint {
    font-size: 11px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

/* ===============================================
   输入组件
   =============================================== */

.param-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.param-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.param-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s;
}

.param-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.param-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.param-number {
    width: 70px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    text-align: center;
}

.param-number:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.6);
    background: rgba(102, 126, 234, 0.08);
}

.param-color {
    width: 50px;
    height: 35px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    background: none;
}

.param-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

.param-color::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

.param-text-short {
    width: 100px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-family: 'Courier New', monospace;
}

.param-text-short:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.6);
    background: rgba(102, 126, 234, 0.08);
}

.param-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.param-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.param-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.param-checkbox span {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

/* ===============================================
   纹理组件
   =============================================== */

.param-texture-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.param-text {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-family: 'Courier New', monospace;
}

.param-text:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.6);
    background: rgba(102, 126, 234, 0.08);
}

.param-btn {
    padding: 8px 14px;
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.param-btn:hover {
    background: rgba(102, 126, 234, 0.25);
    border-color: rgba(102, 126, 234, 0.5);
}

.param-btn-clear {
    width: 30px;
    height: 34px;
    padding: 0;
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 4px;
    color: rgba(255, 107, 107, 0.9);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.param-btn-clear:hover {
    background: rgba(255, 107, 107, 0.25);
    border-color: rgba(255, 107, 107, 0.5);
    transform: scale(1.05);
}

/* ===============================================
   材质库选择器
   =============================================== */

.material-library-selector {
    width: 280px;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.material-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(102, 126, 234, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.material-selector-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.btn-new-material {
    padding: 5px 10px;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.4);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-new-material:hover {
    background: rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.6);
    transform: translateY(-1px);
}

.material-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.material-library-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.material-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    cursor: default;
    transition: all 0.2s;
}

/* 移除材质列表项的hover效果 */
/* .material-list-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateX(3px);
} */

.material-list-item.active {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.material-item-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.material-item-info {
    flex: 1;
    min-width: 0;
}

.material-item-name {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.material-item-meta {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.material-list-empty {
    text-align: center;
    padding: 30px 20px;
    color: rgba(255, 255, 255, 0.4);
}

.material-list-empty p:first-child {
    font-size: 16px;
    margin-bottom: 5px;
}

.material-actions {
    display: flex;
    gap: 8px;
    padding: 12px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.material-action-btn {
    flex: 1;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.material-action-btn:hover:not(:disabled) {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
}

.material-action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.material-action-btn.delete {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.3);
}

.material-action-btn.delete:hover:not(:disabled) {
    background: rgba(255, 107, 107, 0.2);
    border-color: rgba(255, 107, 107, 0.5);
}

/* ===============================================
   材质按钮样式（模型管理列表中）
   =============================================== */

.manage-item-btn.material {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.manage-item-btn.material:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* ===============================================
   响应式调整
   =============================================== */

@media (max-width: 1200px) {
    .material-editor-body {
        flex-direction: column;
    }
    
    .material-preview-container {
        flex: 0 0 300px;
    }
}

@media (max-width: 768px) {
    .material-editor-content {
        width: 98vw;
    }
    
    .material-preview-container {
        flex: 0 0 250px;
    }
    
    .param-input-group {
        flex-wrap: wrap;
    }
    
    .param-number {
        width: 60px;
    }
}

/* ===============================================
   新建材质模态框样式
   =============================================== */

.material-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.material-modal.active {
    display: flex;
}

.material-modal-content {
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: materialModalFadeIn 0.2s ease-out;
}

@keyframes materialModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.material-modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
}

.material-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.material-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.material-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.material-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.material-form-group {
    margin-bottom: 20px;
}

.material-form-group:last-child {
    margin-bottom: 0;
}

.material-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 8px;
}

.material-form-group .required {
    color: #ff6b6b;
    margin-left: 2px;
}

.material-form-group input[type="text"] {
    width: 100%;
    height: 40px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 0 12px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.material-form-group input[type="text"]:focus {
    outline: none;
    border-color: #4a9eff;
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.material-form-group input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.material-form-group select {
    width: 100%;
    height: 40px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 0 12px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.material-form-group select:focus {
    outline: none;
    border-color: #4a9eff;
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.material-form-group select option {
    background: #2a2a2a;
    color: rgba(255, 255, 255, 0.95);
    padding: 8px;
}

.material-form-hint {
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
}

.material-form-hint div {
    margin-top: 4px;
}

.material-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: rgba(255, 255, 255, 0.02);
}

.material-btn-primary,
.material-btn-secondary {
    height: 40px;
    padding: 0 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.material-btn-primary {
    background: linear-gradient(135deg, #4a9eff 0%, #3b7dd6 100%);
    color: white;
}

.material-btn-primary:hover {
    background: linear-gradient(135deg, #5aaeff 0%, #4a8de6 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

.material-btn-primary:active {
    transform: translateY(0);
}

.material-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.material-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ===============================================
   Mesh材质按钮样式
   =============================================== */

.mesh-material-btn {
    width: 24px;
    height: 24px;
    background: rgba(74, 158, 255, 0.2);
    border: 1px solid rgba(74, 158, 255, 0.4);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: 4px;
    flex-shrink: 0;
}

.mesh-material-btn:hover {
    background: rgba(74, 158, 255, 0.3);
    border-color: rgba(74, 158, 255, 0.6);
    transform: scale(1.1);
}

/* 材质信息文本 */
.material-info-text {
    margin-bottom: 20px;
    line-height: 1.6;
}

.material-info-text p {
    margin: 8px 0;
    color: rgba(255, 255, 255, 0.85);
}

.material-info-text strong {
    color: #ff9966;
}

/* 材质信息框 */
.material-info-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
}

.material-info-box h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

/* 材质信息表格 */
.material-info-table {
    width: 100%;
    border-collapse: collapse;
}

.material-info-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.material-info-table tr:last-child {
    border-bottom: none;
}

.material-info-table td {
    padding: 8px 0;
    font-size: 13px;
}

.material-info-table td:first-child {
    color: rgba(255, 255, 255, 0.6);
    width: 100px;
}

.material-info-table td:last-child {
    color: rgba(255, 255, 255, 0.9);
}

/* 颜色预览 */
.color-preview {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    vertical-align: middle;
    margin-right: 6px;
}

/* ===============================================
   材质引用列表样式
   =============================================== */

.material-references-list {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 15px;
    padding: 5px;
}

.reference-item {
    padding: 12px;
    margin: 8px 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.reference-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.reference-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.reference-scene,
.reference-node {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    display: block;
}

.reference-scene::before {
    content: "📍 ";
    margin-right: 4px;
}

.reference-node::before {
    content: "🎯 ";
    margin-right: 4px;
}

.warning-text {
    color: #ff5722;
    font-weight: 500;
    margin: 10px 0;
}

